<template>
  <a-table :columns="tableColumn" :pagination="false" :data-source="tableData" bordered>
  </a-table>
</template>

<script>
import {ref, watch} from "vue";
import locale from "@/locale";

const {t} = locale.global;
const tableColumn = [
  {title: t('问题'), dataIndex: 'title', align: 'center'},
  {
    title: t('客户答案'), dataIndex: 'content', align: 'center', customRender: ({text}) => {
      return text === 1 ? t('是') : t('否')
    }
  },
]
export default {
  name: "index",
  props: {
    userInfo: {}
  },
  setup(props) {
    const tableData = ref([])
    const data = ref({})
    watch(() => props.userInfo.value, (value) => {
      const {isOverdue, isLoans, punctualityRefund, wilRefund, willAssume} = value
      tableData.value = [
        {title: t('是否有过网络借贷成功经历'), content: isLoans},
        {title: t('历史借款是否按期偿还'), content: punctualityRefund},
        {title: t('是否有逾期30天以上未还贷款记录'), content: isOverdue},
        {title: t('是否愿意承担贷款中所产生的费用'), content: willAssume},
        {title: t('是否愿意按期偿还本笔贷款'), content: wilRefund},
      ]
    })
    return {
      tableColumn,
      tableData,
    }
  }
}
</script>

<style scoped>

</style>
